import request from '@/config/axios'

// 车辆保养记录主 VO
export interface VehicleMaintenanceVO {
  id: number // 保养记录ID
  maintenanceDate: Date // 保养日期
  maintenanceCost: number // 保养费用(元)
  vehicleName: string // 车辆名称
  licensePlate: string // 车牌号码
  maintenanceContent: string // 保养内容
  handlerId: string // 经手人
}

// 车辆保养记录主 API
export const VehicleMaintenanceApi = {
  // 查询车辆保养记录主分页
  getVehicleMaintenancePage: async (params: any) => {
    return await request.get({ url: `/oa/vehicle-maintenance/page`, params })
  },

  // 查询车辆保养记录主详情
  getVehicleMaintenance: async (id: number) => {
    return await request.get({ url: `/oa/vehicle-maintenance/get?id=` + id })
  },

  // 新增车辆保养记录主
  createVehicleMaintenance: async (data: VehicleMaintenanceVO) => {
    return await request.post({ url: `/oa/vehicle-maintenance/create`, data })
  },

  // 修改车辆保养记录主
  updateVehicleMaintenance: async (data: VehicleMaintenanceVO) => {
    return await request.put({ url: `/oa/vehicle-maintenance/update`, data })
  },

  // 删除车辆保养记录主
  deleteVehicleMaintenance: async (id: number) => {
    return await request.delete({ url: `/oa/vehicle-maintenance/delete?id=` + id })
  },

  // 导出车辆保养记录主 Excel
  exportVehicleMaintenance: async (params) => {
    return await request.download({ url: `/oa/vehicle-maintenance/export-excel`, params })
  }
}